Skip to content

fix: validate URL against base URL when retreiving pages of items - #271

Merged
rossiam merged 1 commit into
SmartThingsCommunity:mainfrom
rossiam:validate-base-url-on-page
Aug 4, 2026
Merged

fix: validate URL against base URL when retreiving pages of items#271
rossiam merged 1 commit into
SmartThingsCommunity:mainfrom
rossiam:validate-base-url-on-page

Conversation

@rossiam

@rossiam rossiam commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
  • require baseURL in URLProvider (seems like a breaking change but would always fail later if this were left out)
  • validate baseURL in constructor
  • validate all URLs against baseURL
  • updated unit tests
    • include tests for new validations
    • update several other tests to include the now-required baseURL

@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 54d8326

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartthings/core-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rossiam
rossiam requested review from a team and erodewald July 28, 2026 19:06
@rossiam
rossiam force-pushed the validate-base-url-on-page branch from 7584010 to 31c3c6b Compare July 28, 2026 19:07

@erodewald erodewald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also rest-client.ts's RESTClientConfig still lets urlProvider be undefined at runtime. If they pass in undefined, it clobbers the default via spread, and TS won't catch that until RESTClientConfig is tightened.
e.g.,

this.config = { ...defaultConfig, ...config, urlProvider: config?.urlProvider ?? globalSmartThingsURLProvider, headers }

Comment thread src/endpoint-client.ts Outdated
Comment thread test/unit/endpoint-client.test.ts Outdated
Comment thread .changeset/tangy-walls-return.md
@rossiam
rossiam force-pushed the validate-base-url-on-page branch 3 times, most recently from 5c10028 to aa5515b Compare July 30, 2026 14:50
@rossiam
rossiam force-pushed the validate-base-url-on-page branch from aa5515b to 54d8326 Compare July 30, 2026 15:24
@rossiam
rossiam requested a review from erodewald July 30, 2026 15:26
@rossiam
rossiam merged commit 8323653 into SmartThingsCommunity:main Aug 4, 2026
5 checks passed
@rossiam
rossiam deleted the validate-base-url-on-page branch August 4, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants